<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div class="container" id="content">
		<section class="content-header">
			<h1>
				<i class="fa fa-send"></i> <strong>信息登记</strong>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				<li>信息管理</li>
				<li class="active">信息登记</li>
			</ol>
		</section>
		<!-- Main content -->
		<section class="content">
			<div class="row">
				<div class="col-md-12">
					<div class="box box-info">
						<div class="box-header with-border">
							<i class="fa fa-th-list"></i>
							<h4 class="box-title">销售信息登记表</h4>
						</div>
						<form id="chanceRegisterForm" class="widget-box">
							<input type="hidden" name="id" id="id" th:value="${saleChance.id}" />
<!-- 							<input type="hidden" name="id" id="id" th:value="${chanceId}" /> -->
							<input type="hidden" name="isSubmit" id="isSubmit" value="0" />
							<input type="hidden" name="creator" id="creator" />
							<div class="widget-content nopadding">
								<table class="table table-bordered">
									<tbody>
										<tr class="odd gradeX">
											<td width="8%" class="center">信息名称</td>
											<td colspan="3">
												<div class="col-md-11">
													<input class="form-control" type="text" id="name"
														name="name" datatype="*,*1-100,t"
														th:value="${saleChance.name}" />
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
											<td width="8%" class="center">重要程度</td>
											<td width="16%">
												<div class="col-md-11">
												<input type="hidden" name="chancePriority1" id="chancePriority1"
														th:value="${saleChance.chancePriority}" />
													<select class="form-control" type="text"
														id="chancePriority" name="chancePriority"
														datatype="*,*1-100,t">
														<option>☆</option>
						              					<option>☆☆</option>
						              					<option>☆☆☆</option>
						              					<option>☆☆☆☆</option>
						              					<option>☆☆☆☆☆</option>
													</select>
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
										</tr>
										<tr class="odd gradeX">
											<td width="8%" class="center">信息来源</td>
											<td width="16%">
												<div class="col-md-11">
													<input type="hidden" name="source1" id="source1"
														th:value="${saleChance.source}" /> <select
														class="form-control" type="text" id="source" name="source"
														datatype="*,*1-100,t">
														<option></option>
														<option value="设计院">设计院</option>
														<option value="走访">走访</option>
														<option value="电话传真">电话传真</option>
													</select>
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
											<td width="8%" class="center">信息提供人片区</td>
											<td width="16%">
												<div class="col-md-11">
													<select class="form-control" type="text" id="sourceArea"
														name="sourceArea" style="width: 100%">
														<option></option>
														<option th:each="saleArea:${peosaleAreas}"
															th:text="${saleArea.superiorArea}"
															th:selected="${saleArea.superiorArea.equals(saleChance.sourceArea)}">
															
														</option>
													</select>
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
											<td width="8%" class="center">设备主要类型</td>
											<td width="16%">
												<div class="col-md-11">
													<input type="hidden" name="sourceType1" id="sourceType1"
														th:value="${saleChance.sourceType}" /> <select
														class="form-control" type="text" id="sourceType"
														name="sourceType" datatype="*,*1-100,t">
														<option value="无">无</option>
														<option value="离心式">离心式</option>
														<option value="往复式">往复式</option>
														<option value="备件">备件</option>
														<option value="单泵">单泵</option>
														<option value="计量泵">计量泵</option>
										                <option value="往复泵">往复泵</option>
										                <option value="液压隔膜泵">液压隔膜泵</option>
										                <option value="ZD泵">ZD泵</option>
										                <option value="加药装置">加药装置</option>
										                <option value="其他泵">其他泵</option>
													</select>
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
										</tr>
										<tr class="even gradeC">
											<td width="8%" class="center">项目动态</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text" id="projectState"
														name="projectState" th:value="${saleChance.projectState}" />
												</div>
											</td>
											<td width="8%" class="center">信息来源单位</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text" id="sourceUnit"
														name="sourceUnit" datatype="*,*1-100,t"
														th:value="${saleChance.sourceUnit}" />
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
											<td width="8%" class="center">预计订货量（元）</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text" id="orderAmount"
														name="orderAmount" datatype="*,n"
														th:value="${saleChance.orderAmount}" />
												</div>
												<div class="col-md-1">
													<span style="color: #F00">*</span>
												</div>
											</td>
										</tr>
										<tr>
											<td width="8%" class="center">订货单位</td>
											<td width="16%">
												<div class="col-md-10 input-group" style="margin-left: 8px;">
													<input type="hidden" name="customerId" id="customerId"
														th:value="${saleChance.customerId}" /> <input
														class="form-control" type="text" id="orderUnit"
														name="orderUnit" th:value="${saleChance.orderUnit}" readonly="readonly"/> <span
														class="input-group-btn" >
														<button type="button" id="queryCustomer"
															class="btn btn-info" title="引入客户">
															<i class="fa fa-search"></i>
														</button>
													</span>
												</div>
											</td>
											<td width="8%" class="center">设备情况</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text" id="deviceState"
														name="deviceState" th:value="${saleChance.deviceState}" />
												</div>
											</td>
											<td width="8%" class="center">信息提供方影响力</td>
											<td width="16%">
												<div class="col-md-11">
													<input type="hidden" name="sourcePower1" id="sourcePower1"
														th:value="${saleChance.sourcePower}" /> 
														<select class="form-control" type="text" id="sourcePower"
														name="sourcePower">
														<option></option>
														<option>大</option>
														<option>较大</option>
														<option>一般</option>
														<option>较小</option>
													</select>
												</div>
											</td>
										</tr>
										<tr>
											<td width="8%" class="center">订货单位所属片区</td>
											<td width="16%">
												<div class="col-md-11">
													<select class="form-control" type="text" id="orderUnitArea"
														name="orderUnitArea" style="width: 100%">
														<option></option>
														<option th:each="saleArea:${saleAreas}"
															th:text="${saleArea.superiorArea}"
															th:selected="${saleArea.superiorArea.equals(saleChance.orderUnitArea)}">
															
														</option>
													</select>
												</div>
											</td>
											<td width="8%" class="center">订货联系人</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text" id="orderPerson"
														name="orderPerson" th:value="${saleChance.orderPerson}" />
												</div>
											</td>
											<td width="8%" class="center">联系方式</td>
											<td width="16%">
												<div class="col-md-11">
													<input class="form-control" type="text"
														id="orderPersonPhone" name="orderPersonPhone"
														datatype="*,*1-100,t" th:value="${saleChance.orderPersonPhone}" />
												</div>
											</td>
										</tr>
										<tr>
						             		<td width="8%" class="center">收集人</td>
							            	<td width="16%">
								              <div class="col-md-11">
								              	<input class="form-control" type="text" id="userName" name="userName" readonly="readonly" th:value="${saleChance.user.empLogin.name}"/>
					                          </div>
				                          	</td>
				                          	<td width="8%" class="center">所属行业</td>
				                          	<td width="16%">
												<div class="col-md-11">
													<select class="form-control" id="busine" name="busine">
														<option th:each="business:${businesses}"								
													    th:text="${business.title}"
													    th:selected="${business.title.equals(saleChance.business)}"
													     > 
	                                   					 </option>
													</select>
												  </div>
											</td>
						             </tr>
										<tr>
											<td class="center">订货单位地址</td>
											<td colspan="7"><textarea class="form-control"
													 type="text" id="orderUnitAddr" name="orderUnitAddr"
													rows="3" th:text="${saleChance.orderUnitAddr}"></textarea>
											</td>
										</tr>
										<tr>
											<td class="center">提供信息人资料</td>
											<td colspan="7"><textarea class="form-control"
													 type="text" id="sourceOfferInfo" name="sourceOfferInfo"
													rows="3" th:text="${saleChance.sourceOfferInfo}"></textarea>
											</td>
										</tr>
										<tr>
											<td class="center">备注</td>
											<td colspan="7"><textarea class="form-control"
													 style="width: 100%" name="memo" id="memo" rows="3"
													th:text="${saleChance.memo}"></textarea></td>
										</tr>
									</tbody>
								</table>
							</div>

							<div class="box-body">
								<div>
									<lable> <strong>信息关键人物</strong></lable>
									<button type="button" id="deleteBtn"
										class="btn btn-primary pull-right">删除</button>
									<button type="button"
										class="btn btn-primary pull-right editBtn">编辑</button>
									<button type="button" id="addBtn"
										class="btn btn-primary pull-right">添加</button>
								</div>
							</div>
							<div class="box-body">
								<table id="keyManDataTable"
									class="mytable dataTable table-bordered text-center table-striped table-hover"
									cellspacing="0" width="100%">
									<thead>
										<tr>
											<th width="5%">序号</th>
											<th width="3%"><input type="checkbox" id="checkAll" /></th>
											<th width="10%">姓名</th>
											<th width="10%">职务</th>
											<th width="20%">联系方式</th>
											<th width="20%">称呼</th>
											<th width="32%">备注</th>

										</tr>
									</thead>
									<tbody>

									</tbody>
								</table>
							</div>
							<div>
								<a type="button" class="btn btn-primary pull-right"
									href="javascript:history.go(-1)">返回</a>
								<button type="button" class="btn btn-primary pull-right saveBtn">保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</section>

		<!--客户关键人物选择弹窗-->
		<div class="modal" id="kehuModal">
			<div class="modal-dialog" role="dialog">
				<form id="keyManForm">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>信息关键人物</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="form-group">
									<input type="hidden" name="keyManId" id="keyManId" /> <label
										class="col-sm-2 control-label">姓名</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="keyManName"
												id="keyManName" datatype="*,*1-100,t" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00">*</span>
										</div>
									</div>
									<label class="col-sm-2 control-label">职务</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="busine"
												id="busine" />
										</div>

									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">联系方式</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" id="phone" name="phone"
												datatype="*,*1-100,t" />

										</div>
										<div class="col-md-1">
											<span style="color: #F00">*</span>
										</div>
									</div>
									<label class="col-sm-2 control-label">称呼</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="callName"
												id="callName" />
										</div>

									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">备注</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<textarea class="form-control" type="text" name="keyMemo"
												id="keyMemo" datatype="*1-100"></textarea>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="KeyManSave">保存</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--引入客户信息弹窗-->
		<div class="modal" id="queryCustomerModal">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<form id="queryCustomerForm">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>客户信息引入</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="keyword"
												placeholder="Search..." /> <span class="input-group-btn">
												<button type="button" id="search-btn"
													class="btn btn-info searchBtn">查询</button>
												<button type="button" id="reset-btn"
													class="btn btn-info resetBtn">撤消</button>
											</span>
										</div>
									</div>
								</div>
								<div class="box box-body">
									<table id="customerTable"
										class="mytable dataTable table-bordered text-center table-striped table-hover"
										cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="10%">序号</th>
												<th width="20%">单位名称</th>
												<th width="20%">所属片区</th>
												<th width="20%">行业</th>
												<th width="20%">上级单位</th>
												<th width="10%">操作</th>
											</tr>
										</thead>
										<tbody>

										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="pull-in">引入</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<script th:src="@{/chance/chanceRegister.js}"></script>
	</div>
</body>
</html>